<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>历史记录</title>
    <style>
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            border: 1px solid #ccc;
            padding: 8px;
        }
        .btn {
            padding: 5px 10px;
            background-color: #2196F3;
            color: white;
            text-decoration: none;
            border-radius: 3px;
        }
    </style>
</head>
<body>
    <h2>历史商品记录</h2>
    <a href="SellerServlet?method=showDashboard" class="btn">返回后台</a>
    <table>
        <tr>
            <th>ID</th>
            <th>商品名称</th>
            <th>价格</th>
            <th>状态</th>
            <th>创建时间</th>
        </tr>
        <c:forEach items="${products}" var="p">
            <tr>
                <td>${p.id}</td>
                <td>${p.name}</td>
                <td>¥${p.price}</td>
                <td>
                    <c:choose>
                        <c:when test="${p.status == 1}">已上架</c:when>
                        <c:when test="${p.status == 2}">已冻结</c:when>
                        <c:when test="${p.status == 3}">已售出</c:when>
                    </c:choose>
                </td>
                <td>${p.createdTime}</td>
            </tr>
        </c:forEach>
    </table>
</body>
</html>